Example Program
Wildcard Searching
String matching using wildcards.
1#include <iostream>
2#include <seqan/find.h>
3
4using namespace seqan;
5using namespace std;
This program uses the algorithm WildShiftAnd to perform a wildcard search.
6int main() 
7{
8    String<char> hayst = "If you must cross a course cross cow across a crowded cow crossing, "
9                         "cross the cross coarse cow across the crowded cow crossing carefully.";
10    String<char> ndl = "cr?o[uw]";
The pattern matches e.g. "cow", "crow", and "cou", but not "cros".
11    Finder<String<char> > finder(hayst);
12    Pattern<String<char>, WildShiftAnd> pattern(ndl);
13
14    while (find(finder, pattern))
15    {
16        cout << position(finder) << "\n";
17    }
18    return 0;
19}
20
Output
22
35
49
56
93
109
116
Note that the printed positions are the positions of the last characters of the matches.
See Also
SeqAn - Sequence Analysis Library - www.seqan.de